package com.wngbms.spring_boot_learn;

import com.wngbms.spring_boot_learn.anno.EnableMyApp;
import com.wngbms.spring_boot_learn.bean.Bean01;
import com.wngbms.spring_boot_learn.bean.Bean02;
import com.wngbms.spring_boot_learn.bean.Bean03;
import com.wngbms.spring_boot_learn.selector.MyDeferredImportSelector2;
import com.wngbms.spring_boot_learn.selector.MyImportBeanDefinitionRegistrar;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@EnableMyApp
@SpringBootApplication
public class SpringBootLearnApplication {

    public static void main(String[] args) {

        ApplicationContext ac = SpringApplication.run(SpringBootLearnApplication.class, args);

        System.out.println(ac.getBean(Bean01.class));
        System.out.println(ac.getBean(Bean02.class));
        System.out.println(ac.getBean(Bean03.class));
//        抛异常
//        System.out.println(ac.getBean(MyImportBeanDefinitionRegistrar.class));
//        System.out.println(ac.getBean(MyDeferredImportSelector.class));
//        System.out.println(ac.getBean(MyDeferredImportSelector2.class));
//        System.out.println(ac.getBean(MyImportSelector.class));

    }

}
